package com.thebox.config;

import java.util.*;

public class Action {
    private String name = null;
    private String classPath = null;
    private List paramList = null;

    public Action() {
        paramList = new ArrayList();
    }

    public void setName(String str) {
        name = str;
    }

    public void setClassPath(String str) {
        classPath = str;
    }

    public void addActionParam(ActionParam ap) {
        paramList.add(ap);
    }

    public String getName() {
        return name;
    }

    public String getClassPath() {
        return classPath;
    }

    public List getParamList() {
        return paramList;
    }

    public String toString() {
        String newline = System.getProperty("line.separator");
        StringBuffer buf = new StringBuffer();

        buf.append("Action - ").append(name).append(newline);
        buf.append("\tclass=").append(classPath).append(newline);
        buf.append("--------- ActionParam ---------").append(newline);

        for (Iterator it = paramList.iterator(); it.hasNext(); ) {
            buf.append(it.next()).append(newline);
        }

        return buf.toString();
    }

    public static void debug(Object obj) {
        System.out.println("From Action.java: " + obj);
    }
}
